import Mock from 'mockjs';
//import shellAssetsJson from '../../data/media/shellAssets.json';
import shellAssetsJson from '../../data/media2/assets.json';

export default {
    className: "Media.Audit.AssetIssuance",
    queryData: function(postData) {
        var json=[];
        var j = 0;
        for (var i = 0; i < shellAssetsJson.length; i++) {
        if (postData.condition.assetName.val=="" || postData.condition.assetName.val == shellAssetsJson[i].assetName) {
        json[j] = shellAssetsJson[i];
        j++;
        }
        }
        return Mock.mock({
            isSuccess: "Y",
            reason: "",
            message: [],
            "data": {
                "recordCount": json.length,
                "pageCount": 1,
                "pageIndex": 1,
                "pageSize": 20,
                "queryResult": json,
                // "queryResult|28": [{
                //     "keyID|1000-9999": 1000,
                //     "code": /^[1-9][1-9][1-9][1-9][1-9][1-9][1-9][1-9]$/,
                //     "heading": Mock.mock('@ctitle'),//@title为英文版
                //     "episode": 1,
                //     "column": "电影",
                //     "status": "发布成功",
                //     "servicePackage": "无",
                //     "stencil": "电影",
                //     "createTime": Mock.mock('@now'),
                //     "lastUpdateTime": Mock.mock('@now'),
                //     "version": 1
                // }]
            }
        });
    },
    queryByKeyID: function(postData) {
        return Mock.mock({
            isSuccess: "Y",
            reason: "",
            message: [],
            "data": {
                "keyID|1000-9999": 1000,
                "code": /^[1-9][1-9][1-9][1-9][1-9][1-9][1-9][1-9]$/,
                "heading": Mock.mock('@ctitle'),//@title为英文版
                "episode": 1,
                "column": "电影",
                "status": "发布成功",
                "servicePackage": "无",
                "stencil": "电影",
                "createTime": Mock.mock('@now'),
                "lastUpdateTime": Mock.mock('@now'),
                "version": 1
            }
        });
    },
};
